from django.urls import path
from apps.headline import views
# from apps.headline.views import ArticleModelViewSet

urlpatterns = [
    path('channels/', views.channels),
    # 查询该频道所有文章
    path('article/<id>/channel/', views.get_articles_by_channel_id),
    # 发表文章，查询文章
    # path('article/<id>', views.create_article),
    path('article/', views.create_article),

    # 查询文章，详情
    path('article/<id>/', views.article_detail),
    # 查询一篇文章，修改文章
    # 查询所有标签
    path('labels/', views.list_label),
    # 收藏文章
    path('article/<id>/collect/', views.article_collect),
    # 评论文章
    path('article/<id>/publish_comment/', views.publish_comment),
    path('articles/search/', views.ElaticSearchView.as_view())
]

#
# from rest_framework import routers
#
# router = routers.DefaultRouter()
#
# router.register(path('article'), ArticleModelViewSet, basename='article_view_set')
#
# urlpatterns += router.urls



